package com.ubst.smartad.impl.admin.auth;

import java.sql.*;
import java.util.*;
import java.io.*;

import com.ubst.smartad.common.TimeUtil;
import com.ubst.smartad.logger.Debug;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

public class AuthMngImpl {
	
	Connection con = null;
	private String serverName;
	private Debug debug;
	//private FileHostEnv fhostEnv;


    /** 
     * 생성자
     *   
     *   
    */ 
	public AuthMngImpl(Connection con, String serverName, String log_level) {
		this.con = con;
		this.serverName = serverName;
		this.debug = new Debug("AuthMngImpl", log_level);
		//this.fhostEnv = FileHostEnv.getInstance(serverName);

	}

	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Command(명령어 실행제어) jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridCommandList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat2");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat3");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat4");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat5");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("target", "/sbin/");
		log_data_map.put("authority", "root");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Command(명령어 실행제어) Log jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridCommandLogList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리2");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리3");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리4");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리5");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("calender", "2013-01-13 22:52:01");
		log_data_map.put("type", "계정관리");
		log_data_map.put("work", "계정정책변경");
		log_data_map.put("result", "성공");
		log_data_map.put("important", "정보");
		log_data_map.put("worker", "adadmin");
		log_data_map.put("ip_addr", "192.168.1.1");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Command(명령어 실행제어) Info 정보 가져오기 View
	 * 
	 *	Primary key: system_name(가상설정)
	 */
	public HashMap getCommandInfo(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "redhat_TEST");
			log_info_map.put("rule_kind", "파일시스템 접근제어");
			log_info_map.put("target", "/etc/rc.d/init.d/cm");
			log_info_map.put("ex", "설명입니다");
			log_info_map.put("auth_list", "root");
			log_info_map.put("status", "동기화");
			log_info_map.put("last_sync_time", "192.168.1.1");

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return log_info_map;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Command(명령어 실행제어) Log 클릭시 Popup창으로 Info 가져오기
	 *	key: ip_addr(가상설정)
	 */
	public HashMap command_detail(String ip_addr) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("log_time", "2013-05-03 09:50:03");
			log_info_map.put("log_type", "계정관리");
			log_info_map.put("work_type", "계정정책 변경");
			log_info_map.put("user", "adadmin");
			log_info_map.put("account", "test1234");
			log_info_map.put("ip_addr", "192.168.1.1");
			log_info_map.put("target_system", "IDMServer");
			log_info_map.put("service", "webadmin");
			log_info_map.put("result", "실패");
			log_info_map.put("detail", "상세내역입니다");

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		
		return log_info_map;
	}
	
	
	/**
	 * @author : Kswany 
	 * auth(권한) - Command- command팝업 insert
	 *	key: system_name(가상설정)
	 */
	public boolean insertCommandPopup(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();
		boolean result = false;
		try {

			String command = String.valueOf(param.get("command"));
			String auth_list = String.valueOf(param.get("auth_list"));
			String ex = String.valueOf(param.get("ex"));
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * auth(권한) - Command delete(list checkbox선택후 삭제, 리스트 마지막으로 클릭 한 상세정보에서 삭제)
	 *	key: system_name(가상설정)
	 */
	public boolean deleteCommand(List array) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
	
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 *auth(권한) - Command insertCommandInfo
	 *	key: work_no(가상설정)
	 */
	public boolean insertCommandInfo(String work_no) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Object(객체 접근제어) jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridObjectList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat2");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat3");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat4");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat5");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("system_name", "redhat");
			log_data_map.put("target", "/sbin/");
			log_data_map.put("authority", "root");
			log_data_map.put("status", "동기화");
			log_data_map.put("sync", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Object(객체 접근제어) Log jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridObjectLogList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리2");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리3");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리4");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리5");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Object(객체 접근제어) Info 정보 가져오기 View
	 * 
	 *	key: system_name(가상설정)
	 */
	public HashMap getObjectInfo(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "redhat_TEST");
			log_info_map.put("rule_kind", "파일시스템 접근제어");
			log_info_map.put("target", "/etc/rc.d/init.d/cm 등록");
			log_info_map.put("ex", "설명입니다");
			log_info_map.put("auth_list", "root");
			log_info_map.put("access_auth", "2");
			log_info_map.put("lock_status", "0");
			log_info_map.put("account_status", "동기화");
			log_info_map.put("last_contact_gear", "2013-04-19-17:17:10");

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		return log_info_map;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Object(객체 접근제어) Log 클릭시 Popup창으로 Info 가져오기
	 *	key: ip_addr(가상설정)
	 */
	public HashMap object_detail(String ip_addr) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("log_time", "2013-05-03 09:50:03");
			log_info_map.put("log_type", "계정관리");
			log_info_map.put("work_type", "계정정책 변경");
			log_info_map.put("user", "adadmin");
			log_info_map.put("account", "test1234");
			log_info_map.put("ip_addr", "192.168.1.1");
			log_info_map.put("target_system", "IDMServer");
			log_info_map.put("service", "webadmin");
			log_info_map.put("result", "실패");
			log_info_map.put("detail", "상세내역입니다");

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		
		return log_info_map;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Object(객체 접근제어)- 팝업 insert
	 *	key: system_name(가상설정)
	 */
	public boolean insertObjectPopup(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();
		boolean result = false;
		try {

			String command = String.valueOf(param.get("command"));
			String auth_list = String.valueOf(param.get("auth_list"));
			String ex = String.valueOf(param.get("ex"));
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Object(객체 접근제어) delete(list checkbox선택후 삭제, 리스트 마지막으로 클릭 한 상세정보에서 삭제)
	 *	key: system_name(가상설정)
	 */
	public boolean deleteObject(List array) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
	
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Object(객체 접근제어) insertCommandInfo
	 *	key: work_no(가상설정)
	 */
	public boolean insertObjectInfo(String work_no) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	
	
	
	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Network(네트워크 접근제어)-들어오는 포트  jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridNetworkList_in(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat1");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat2");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat3");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat4");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat5");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("in_port", "21");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Network(네트워크 접근제어)-들어오는 포트 Log jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridNetworkLogList_in(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리2");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리3");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리4");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리5");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);

	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-들어오는포트  Info정보 가져오기 View
	 * 
	 *	key: system_name(가상설정)
	 */
	public HashMap getNetworkInfo_in(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "redhat_TEST");
			log_info_map.put("in_port", "2013-07-06");
			log_info_map.put("out_port", "시스템 등록");
			log_info_map.put("in_ip_addr", "192.168.1.1");
			log_info_map.put("control_if", "계정등록");
			log_info_map.put("status", "성공");
			log_info_map.put("sync", "정보");
		
			
		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		return log_info_map;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어) Log 클릭시 Popup창으로 Info 가져오기
	 *	key: ip_addr(가상설정)
	 */
	public HashMap network_detail(String ip_addr) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("log_time", "2013-05-03 09:50:03");
			log_info_map.put("log_type", "계정관리");
			log_info_map.put("work_type", "계정정책 변경");
			log_info_map.put("user", "adadmin");
			log_info_map.put("account", "test1234");
			log_info_map.put("ip_addr", "192.168.1.1");
			log_info_map.put("target_system", "IDMServer");
			log_info_map.put("service", "webadmin");
			log_info_map.put("result", "실패");
			log_info_map.put("detail", "상세내역입니다");

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		
		return log_info_map;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-들어오는 포트- 팝업 insert
	 *	key: system_name(가상설정)
	 */
	public boolean insertNetwork_inPopup(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();
		boolean result = false;
		try {

			String command = String.valueOf(param.get("command"));
			String auth_list = String.valueOf(param.get("auth_list"));
			String ex = String.valueOf(param.get("ex"));
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-들어오는 delete(list checkbox선택후 삭제, 리스트 마지막으로 클릭 한 상세정보에서 삭제)
	 *	key: system_name(가상설정)
	 */
	public boolean deleteNetwork_in(List array) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
	
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-들어오는 insertCommandInfo
	 *	key: work_no(가상설정)
	 */
	public boolean insertNetwork_inInfo(String work_no) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	
	
	
	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Network(네트워크 접근제어)-나가는 포트  jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridNetworkList_out(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat1");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat2");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat3");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");		
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat4");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");		
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat5");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("system_name", "redhat");
		log_data_map.put("out_port", "!23*");
		log_data_map.put("in_port", "21");
		log_data_map.put("control_if", "192.168.1.2");
		log_data_map.put("status", "동기화");
		log_data_map.put("sync", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	Auth(권한) - Network(네트워크 접근제어)-나가는 포트  Log jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridNetworkLogList_out(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리2");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리3");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리4");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리5");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("calender", "2013-01-13 22:52:01");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책변경");
			log_data_map.put("result", "성공");
			log_data_map.put("important", "정보");
			log_data_map.put("worker", "adadmin");
			log_data_map.put("ip_addr", "192.168.1.1");
			log_datas.add(log_data_map);

	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-나가는 포트  Info정보 가져오기 View
	 *	key: system_name(가상설정)
	 */
	public HashMap getNetworkInfo_out(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "redhat_TEST");

			log_info_map.put("out_port", "시스템 등록");
			log_info_map.put("in_port", "2013-07-06");
			log_info_map.put("in_ip_addr", "192.168.1.1");
			log_info_map.put("control_if", "계정등록");
			log_info_map.put("status", "성공");
			log_info_map.put("sync", "정보");
		
			
		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		return log_info_map;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-나가는 포트- 팝업 insert
	 *	key: system_name(가상설정)
	 */
	public boolean insertNetwork_outPopup(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();
		boolean result = false;
		try {

			String command = String.valueOf(param.get("command"));
			String auth_list = String.valueOf(param.get("auth_list"));
			String ex = String.valueOf(param.get("ex"));
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-나가는 포트 delete(list checkbox선택후 삭제, 리스트 마지막으로 클릭 한 상세정보에서 삭제)
	 *	key: system_name(가상설정)
	 */
	public boolean deleteNetwork_out(List array) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
	
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * Auth(권한) - Network(네트워크 접근제어)-나가는 포트 insertCommandInfo
	 *	key: work_no(가상설정)
	 */
	public boolean insertNetwork_outInfo(String work_no) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * network out port + 클릭시 insert
	 * 
	 */
	public boolean insertOutPort(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String out_port_choice = String.valueOf(param.get("out_port_choice"));
			String out_port_choice2 = String.valueOf(param.get("out_port_choice2"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * network out port - 클릭시 delete
	 * 
	 */
	public boolean deleteOutPort(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String out_port_choice = String.valueOf(param.get("out_port_choice"));
			String out_port_choice2 = String.valueOf(param.get("out_port_choice2"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	/**
	 * @author : Kswany 
	 * network control  + 클릭시 insert
	 * 
	 */
	public boolean insertControl(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String control_if_choice = String.valueOf(param.get("control_if_choice"));
			String control_if_choice2 = String.valueOf(param.get("control_if_choice2"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * network control - 클릭시 delete
	 * 
	 */
	public boolean deleteControl(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String control_if_choice = String.valueOf(param.get("control_if_choice"));
			String control_if_choice2 = String.valueOf(param.get("control_if_choice2"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	/**
	 * @author : Kswany 
	 * 공통 권한추가  + 클릭시 insert
	 * 
	 */
	public boolean insertAuth(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String member = String.valueOf(param.get("target_list"));
			String member_type = String.valueOf(param.get("system_type"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * 공통 권한삭제 - 클릭시 delete
	 * 
	 */
	public boolean deleteAuth(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String member = String.valueOf(param.get("target_list"));
			String member_type = String.valueOf(param.get("system_type"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * network in port  + 클릭시 insert
	 * 
	 */
	public boolean insertInPort(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String in_port_choice = String.valueOf(param.get("in_port_choice"));
			String in_port_choice2 = String.valueOf(param.get("in_port_choice2"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * network in port - 클릭시 delete
	 * 
	 */
	public boolean deleteInPort(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String in_port_choice = String.valueOf(param.get("in_port_choice"));
			String in_port_choice2 = String.valueOf(param.get("in_port_choice2"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	/**
	 * @author : Kswany 
	 * network in ipAddr  + 클릭시 insert
	 * 
	 */
	public boolean insertIpAddr(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String in_ip_addr = String.valueOf(param.get("in_ip_addr"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * network in ipAddr - 클릭시 delete
	 * 
	 */
	public boolean deleteIpAddr(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String in_ip_addr = String.valueOf(param.get("in_ip_addr"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}

}
